#include "stdafx.h"
#include <serialization/ioParamStructs.h>
#include <serialization/serialization.h>
#include <winsock/winsock_stub.h>

void setsockopt_stub (
    __in  std::vector<char>& in_buf,
    __out std::vector<char>& out_buf
    )
{
//RECEIVE()
    Deserialize deserialize (in_buf);
    setsockopt_in_inout setsockoptIN;
    deserialize (setsockoptIN);

    int ret = setsockopt (setsockoptIN.s_, setsockoptIN.level_, 
            setsockoptIN.optname_, setsockoptIN.optval_,
            setsockoptIN.optlen_);
//SEND
    setsockopt_out_inout setsockoptOUT( (ret == 0) ? 0 : WSAGetLastError() );
    
    Serialize(deserialize.get_header(), setsockoptOUT, out_buf);
}